<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>mark</title>
</head>
<body>
	<% 
		request.setCharacterEncoding("UTF-8");
		String userName = request.getParameter("userName");
		String userSex = request.getParameter("sex");
		String hobby[] = request.getParameterValues("hobby");
		String str = "";
		if (hobby != null) {
			for (int i = 0; i < hobby.length; i++) {
				str = str + hobby[i] + ",";
			}
		}
	%>
	<form name = "fm">
		<input type = "text" name = "userName" value = "<%=userName%>"><br>
		<input type = "radio" name = "sex" id = "sex1" value = "男"
			<%if (userSex.equals("男"))
				out.println("checked = 'true'");%>>男
			&nbsp;&nbsp;
		<input type = "radio" name = "sex" id = "sex2" value = "女"
			<%if (userSex.equals("女"))
				out.println("checked = 'true'");%>>女<br>
		<input type = "checkbox" name = "hobby" id = "hobby1" value = "篮球"<%if(str.contains("篮球")) out.println("checked = 'true'");%>>篮球
		&nbsp;&nbsp;
		<input type = "checkbox" name = "hobby" id = "hobby2" value = "乒乓球"<%if(str.contains("乒乓球")) out.println("checked = 'true'");%>>乒乓球
		&nbsp;&nbsp;
		<input type = "checkbox" name = "hobby" id = "hobby3" value = "羽毛球"<%if(str.contains("羽毛球")) out.println("checked = 'true'");%>>羽毛球
	</form>
</body>
</html>